<?php
include 'topo.php';

$sql = "SELECT * FROM fazenda WHERE fazenda.hectares > 1000
 order by nome";
 $res = pg_query($sql);
 $optFazenda = "";
 while($linha=pg_fetch_assoc($res))
 {
    $id = $linha["id"];
    $nome = $linha["nome"];
    $optFazenda.= "<option value='$id'>$nome</option>";
 }

 
?>
        
        <div style="text-align:center;font-family: arial">


            <form action="proprietario-cadastrar-ok.php" method="post"> 
                <table border="0" cellpadding="0" cellspacing="0" width="25%">
                    <tr> 
                        <td width="30%">Nome:</td>
                        <td width="70%"><input type="text" name="nome" 
                            required/></td>
                    </tr> 
                    <tr> 
                        <td width="30%">Fone:</td>
                        <td width="70%">
                        <input style="width:25px" type="text" name="fone1"/>
                        <input style="width:207px" type="text" name="fone2"/>

                        </td>
                    </tr>
                     <tr> 
                        <td width="30%">Fazenda:</td>
                        <td width="70%">
                        <select name="minhafazendaid">
                            <option value="">selecione</option>
                            <?php echo $optFazenda?>
                        </select>
                        </td>
                    </tr>
                     <tr> 
                        <td width="30%">Avatar:</td>
                        <td width="70%">
                        <input type="text" name="avatar"/>
                        </td>
                    </tr>
                    <tr>
                        <td width="30%">Brasileiro:</td>
                        <td width="70%">
                            <input type="radio" name="brasileiro" value="Sim" />Sim
                            <input type="radio" name="brasileiro" value="Não" />Não
                            <input type="radio" name="brasileiro" value="Naturalizado" />Naturalizado
                        </td>
                    </tr> 
                    <tr>
                        <td align="right" colspan='2'> 
                            <input type="submit" name="bot_enviar" value="CADASTRAR"/> 
                        </td> 
                    </tr> 
                </table> 
            </form>	


        </div>
    </body>
</html>